home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume16 / plp / part02 < prev    next >
Encoding:
Internet Message Format  |  1988-09-22  |  57.9 KB

  1. Path: uunet!bbn.com!rsalz
  2. From: rsalz@uunet.uu.net (Rich Salz)
  3. Newsgroups: comp.sources.unix
  4. Subject: v16i015:  Public lineprinter spooler package, Part02/16
  5. Message-ID: <1068@fig.bbn.com>
  6. Date: 14 Sep 88 20:13:32 GMT
  7. Lines: 1994
  8. Approved: rsalz@uunet.UU.NET
  9.  
  10. Submitted-by: papowell@julius.cs.umn.edu
  11. Posting-number: Volume 16, Issue 15
  12. Archive-name: plp/part02
  13.  
  14.  
  15.  
  16. #! /bin/sh
  17. # This is a shell archive.  Remove anything before this line, then unpack
  18. # it by saving it into a file and typing "sh file".  To overwrite existing
  19. # files, type "sh file -c".  You can also feed this as standard input via
  20. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  21. # will see the following message at the end:
  22. #        "End of archive 2 (of 16)."
  23. # Contents:  ANNOUNCE FILES doc/PLP/00.t doc/PLP/03.t doc/PLP/10.t
  24. #   doc/PLP/12.t doc/PLP/announce filters/compat.c man/checkpc.1
  25. #   man/pac.8 man/printer.1 man/printers.1 src/find_name.c
  26. #   src/getprinter.c src/lpr.h src/lpr_global.c src/startserver.c
  27. #   src/termclear.c utilities/cpr/cpr.1
  28. # Wrapped by papowell@attila on Wed Aug 10 10:44:46 1988
  29. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  30. if test -f 'ANNOUNCE' -a "${1}" != "-c" ; then 
  31.   echo shar: Will not clobber existing file \"'ANNOUNCE'\"
  32. else
  33. echo shar: Extracting \"'ANNOUNCE'\" \(2540 characters\)
  34. sed "s/^X//" >'ANNOUNCE' <<'END_OF_FILE'
  35. X              PLP - The Public Line Printer Spooler
  36. X               A Portable UNIX Line Printer Spooler
  37. X                     Release 2.0, 1 June 1988
  38. X                       Prof. Patrick Powell
  39. X                    Dept. of Computer Science
  40. X         University of Minnesota, Minneapolis, Minnesota
  41. X     PLP is a public domain version of the Berkeley LPD software.
  42. The  functional  resemblance  between  PLP  and the Berkeley Line
  43. Printer Spooler (LPD) is intentional; the source code was written
  44. without  reference  to the original Berkeley LPD software, except
  45. for  some  very  small sections concerned with networking and the
  46. large  characters used for banner printing.  The PLP software has
  47. the following features:
  48. X1).The  PLP  software is intended to be  used in a Networked File
  49. X   System  (NFS)  environment,  in which there is a common set of
  50. X   spool  queues,  as well as in a loosely coupled environment in
  51. X   which  each  host transfers print jobs to a host which has the
  52. X   printer.
  53. X2).Access  and  permission  to use PLP functions is controlled by
  54. X   entries      in      a      printer      permissions      file
  55. X   (/usr/spool/lpd/printer_perms.<hostname>)  which  can restrict
  56. X   use  by  user  name, host, spooler, page useage, and a host of
  57. X   other         factors.         The        printcap        file
  58. X   (/usr/spool/lpd/printcap.<hostname>)  is  used  to specify the
  59. X   printer queues and their operation.
  60. X3).Jobs  can now be prioritized.  The maximum priority a user can
  61. X   specify is set in the printer permissions file.
  62. X4).In  addition  to  the  general  printer permissions file, each
  63. X   spool  queue  can  have  its  own addition printer permissions
  64. X   file.
  65. X5).Line  printer control functions can be exercised from a remote
  66. X   host.   Hosts  and  users  with  remote control permission are
  67. X   specified by entries in the printer permissions file.
  68. X6).Unspooling  of  jobs  can be performed by a printcap specified
  69. X   program, rather than by the PLP unspooler.  This allows PLP to
  70. X   be used as a spooler and to have spool queues used for various
  71. X   purposes.
  72. X7).Extremely  verbose  and chatty error messages have been added.
  73. X   These  greatly  ease debugging and installation.  In addition,
  74. X   the  checkpc  utility  can be used to set file permissions and
  75. X   other items for use by the PLP software.
  76. X8).The code is quite portable, with as few system dependencies in
  77. X   it as possible.  It has run on a VAX 4.2, 4.3, and ULTRIX, SUN
  78. X   3.0, and DG-UX.
  79. X____________
  80. X* UNIX is a trademark of ATT Bell Laboratories.
  81. END_OF_FILE
  82. if test 2540 -ne `wc -c <'ANNOUNCE'`; then
  83.     echo shar: \"'ANNOUNCE'\" unpacked with wrong size!
  84. fi
  85. # end of 'ANNOUNCE'
  86. fi
  87. if test -f 'FILES' -a "${1}" != "-c" ; then 
  88.   echo shar: Will not clobber existing file \"'FILES'\"
  89. else
  90. echo shar: Extracting \"'FILES'\" \(2713 characters\)
  91. sed "s/^X//" >'FILES' <<'END_OF_FILE'
  92. ANNOUNCE
  93. Copyright
  94. XFILES
  95. MANIFEST
  96. LICENSE
  97. Makefile
  98. README
  99. backup
  100. backup/lpr.remove
  101. backup/save.lpr
  102. backup/restore.lpr
  103. backup/Makefile
  104. backup/lpr.save
  105. doc
  106. doc/PLP
  107. doc/PLP/12.t
  108. doc/PLP/dict
  109. doc/PLP/02.t
  110. doc/PLP/03.t
  111. doc/PLP/04.t
  112. doc/PLP/05.t
  113. doc/PLP/06.t
  114. doc/PLP/11.t
  115. doc/PLP/07.t
  116. doc/PLP/Makefile
  117. doc/PLP/README
  118. doc/PLP/macros
  119. doc/PLP/09.t
  120. doc/PLP/10.t
  121. doc/PLP/00.t
  122. doc/PLP/announce
  123. doc/PLP/01.t
  124. doc/PLP/08.t
  125. doc/PLP/LICENSE
  126. filters
  127. filters/compat.c
  128. filters/Makefile
  129. filters/lpf.c
  130. filters/main.c
  131. filters/pf_main.c
  132. filters/pref_main.c
  133. filters/vdmp.c
  134. man
  135. man/lpq.1
  136. man/lpr.1
  137. man/lprm.1
  138. man/Makefile
  139. man/pac.8
  140. man/README
  141. man/lpd.8
  142. man/printcap.5
  143. man/printer.1
  144. man/printers.1
  145. man/lpc.1
  146. man/checkpc.1
  147. printcap
  148. printcap/hosts
  149. printcap/hosts/dg
  150. printcap/hosts/julius
  151. printcap/hosts/umn-cs
  152. printcap/printers
  153. printcap/printers/diablo_lind136.remote
  154. printcap/printers/dg2_lind25.remote
  155. printcap/printers/dg3_lind25.remote
  156. printcap/printers/hp2563_lind25.remote
  157. printcap/printers/hp_lind54.remote
  158. printcap/printers/epson_lind27.remote
  159. printcap/printers/dgt_lind27.remote
  160. printcap/printers/apple_lind26a.remote
  161. printcap/printers/apple_lind26a.local
  162. printcap/printers/imagen_lind27.local
  163. printcap/printers/imagen_lind27.remote
  164. printcap/printers/diablo_lind136.local
  165. printcap/printers/dg1_lind1.remote
  166. printcap/printers/laserjetplus_lind25.remote
  167. printcap/printers/dg2_lind25.forward
  168. printcap/printers/dg3_lind25.forward
  169. printcap/printers/dgt_lind27.forward
  170. printcap/printers/hp2563_lind25.forward
  171. printcap/printers/hp_lind54.forward
  172. printcap/printers/laserjetplus_lind25.forward
  173. printcap/printers/dg1_lind1.forward
  174. printcap/printcap
  175. printcap/README
  176. printcap/Makefile
  177. printcap/genpc
  178. src
  179. src/banner.c
  180. src/chartable.c
  181. src/checkpc.c
  182. src/checkperm.c
  183. src/displayq.c
  184. src/errormsg.c
  185. src/getopt.c
  186. src/getprinter.c
  187. src/global.c
  188. src/link_support.c
  189. src/localprinter.c
  190. src/lockfile.c
  191. src/lpc.c
  192. src/lpd.c
  193. src/lpq.c
  194. src/control_ops.c
  195. src/lp.h
  196. src/lpr_filters.c
  197. src/lpr_global.c
  198. src/utils.c
  199. src/lpr_parms.c
  200. src/lpr_temp.c
  201. src/lprm.c
  202. src/pac.c
  203. src/mexecv.c
  204. src/print_support.c
  205. src/printcap.c
  206. src/recvfiles.c
  207. src/remoteprinter.c
  208. src/rmjob.c
  209. src/sendmail.c
  210. src/servicereq.c
  211. src/setstatus.c
  212. src/setup_filter.c
  213. src/setup_test.c
  214. src/startprinter.c
  215. src/lpr.c
  216. src/Makefile
  217. src/lpr.h
  218. src/README
  219. src/IDENT
  220. src/remote_ops.c
  221. src/find_name.c
  222. src/startserver.c
  223. src/termclear.c
  224. src/lpr_job.c
  225. src/lpr_canprint.c
  226. src/patchlevel.h
  227. test
  228. test/filter.sh
  229. test/printcap.proto
  230. test/qh.sh
  231. test/linetest.c
  232. test/README
  233. test/Makefile
  234. test/printer_perms.proto
  235. utilities
  236. utilities/cpr
  237. utilities/cpr/cpr.c
  238. utilities/cpr/Makefile
  239. utilities/cpr/cpr.1
  240. utilities/print
  241. utilities/print/print.sh
  242. utilities/print/print.1
  243. utilities/print/Makefile
  244. utilities/Makefile
  245. utilities/IDENT
  246. END_OF_FILE
  247. if test 2713 -ne `wc -c <'FILES'`; then
  248.     echo shar: \"'FILES'\" unpacked with wrong size!
  249. fi
  250. # end of 'FILES'
  251. fi
  252. if test -f 'doc/PLP/00.t' -a "${1}" != "-c" ; then 
  253.   echo shar: Will not clobber existing file \"'doc/PLP/00.t'\"
  254. else
  255. echo shar: Extracting \"'doc/PLP/00.t'\" \(2536 characters\)
  256. sed "s/^X//" >'doc/PLP/00.t' <<'END_OF_FILE'
  257. X.ig
  258. X$Header: 00.t,v 1.1 88/05/21 18:39:29 papowell Locked $
  259. X$log$
  260. X..
  261. X.RP
  262. X.EH 'PLP-%''PLP Manual'
  263. X.OH 'PLP Manual''PLP-%'
  264. X.nr CW 2.85i
  265. X.nr GW .3i
  266. X.TL
  267. PLP \- The Public Line Printer Spooler
  268. X.br
  269. A Portable UNIX Line Printer Spooler
  270. X.br
  271. Release 2.0, 1 June 1988
  272. X.AU
  273. Prof. Patrick Powell
  274. X.AI
  275. Dept. of Computer Science
  276. University of Minnesota, Minneapolis, Minnesota
  277. X.AB
  278. X.FS
  279. X* UNIX is a trademark of ATT Bell Laboratories.
  280. X.FE
  281. This document describes the Public Line Printer Spooler (PLP).
  282. The functional resemblance between this software and the
  283. Berkeley Line Printer Spooler (LPD) is intentional.
  284. The PLP software has the following features:
  285. X.IP 1). 5
  286. The PLP software is intended to be  used in a Networked File System
  287. X(NFS) environment,
  288. in which there is a common set of spool queues,
  289. as well as in a loosely coupled environment in which each host
  290. transfers print jobs to a common host.
  291. X.IP 2). 5
  292. Access and permission to use
  293. PLP functions is controlled by entries in a printer permissions file
  294. X.I (/usr/spool/lpd/printer_perms.<hostname>)
  295. which can restrict use by user name,
  296. host,
  297. spooler,
  298. page useage,
  299. and a host of other factors.
  300. The printcap file
  301. X.I (/usr/spool/lpd/printcap.<hostname>)
  302. is used to specify the printer queues and their operation.
  303. X.IP 3). 5
  304. Jobs can now be prioritized.
  305. The maximum priority a user can specify is set in the
  306. printer permissions file.
  307. X.IP 4). 5
  308. In addition to the general printer permissions file,
  309. each spool queue can have its own addition printer permissions file.
  310. X.IP 5). 5
  311. Line printer control functions can be exercised from a remote host.
  312. Hosts and users with
  313. remote control permissions are specified
  314. by entries in the printer permissions file.
  315. X.IP 6). 5
  316. The unspooling of jobs can be performed by a user defined program,
  317. rather than the spooler.
  318. This allows the spooler to be used to send jobs to remote sites
  319. using various file transfer protocols.
  320. X.IP 7). 5
  321. XExtremely verbose and chatty error messages have been added.
  322. These greatly ease debugging and installation.
  323. In addition,
  324. the
  325. X.I checkpc
  326. utility can be used to set file permissions and other items for
  327. use by the PLP software.
  328. X.PP
  329. XFor complex legal reasons,
  330. PLP is NOT public domain software,
  331. but may be copied and/or modified as long as the original copyright
  332. notification is retained.
  333. X.AE
  334. X.de IR
  335. X\fI\\$1\fP\\$2
  336. X..
  337. X.de BR
  338. X\fB\\$1\fP\\$2
  339. X..
  340. X.de DT
  341. X.ta 4n +4n +4n +4n +4n +4n +4n +4n +4n +4n +4n 8i
  342. X..
  343. X.    \" CW - H - Helvetica
  344. X.de L
  345. X.nr pq \\n(.f
  346. X.if t .ft CW
  347. X.if n .ft 1
  348. X.if !\e\\$1\e\e \&\\s-\\n(Ls\\$1\|\\s+\\n(Ls\f\\n(pq\\$2
  349. X..
  350. X.nr Ls 2
  351. END_OF_FILE
  352. if test 2536 -ne `wc -c <'doc/PLP/00.t'`; then
  353.     echo shar: \"'doc/PLP/00.t'\" unpacked with wrong size!
  354. fi
  355. # end of 'doc/PLP/00.t'
  356. fi
  357. if test -f 'doc/PLP/03.t' -a "${1}" != "-c" ; then 
  358.   echo shar: Will not clobber existing file \"'doc/PLP/03.t'\"
  359. else
  360. echo shar: Extracting \"'doc/PLP/03.t'\" \(2930 characters\)
  361. sed "s/^X//" >'doc/PLP/03.t' <<'END_OF_FILE'
  362. X.ig
  363. X$Header: 03.t,v 1.1 88/05/21 18:39:36 papowell Locked $
  364. X$log$
  365. X..
  366. X.NH 1
  367. Spool Directories, Programs, and Permissions
  368. X.PP
  369. XEach spool queue has a spool directory that contains the
  370. control and data files associated with a job.
  371. The permissions and ownerships of
  372. spool directories and PLP software are intended to allow only PLP programs
  373. to read,
  374. write,
  375. or remove jobs from the spool directory.
  376. The strategy used to protect
  377. spooling information is as follows:
  378. X.IP 1). 4
  379. XEach spool queue directory is owned by user
  380. X.I daemon
  381. and group
  382. X.I deamon .
  383. The spool queue directory permissions are 0755, i.e.-
  384. user (daemon) rwx,
  385. group (daemon) rx,
  386. and other rx.
  387. X.FS
  388. These could be restricted to 0600,
  389. user (daemon) rw only,
  390. as PLP programs run SUID
  391. X.IR root .
  392. X.FE
  393. X.IP 2). 4
  394. All the PLP programs which modify or read the entries in the
  395. spool queue directories run SUID
  396. X.IR root .
  397. The SUID
  398. X.I root
  399. is needed on several UNIX implementations in
  400. order to change the file ownership and group information.
  401. X.IP 3). 4
  402. Control and data files in the spooling directories have owner
  403. X.I daemon 
  404. and
  405. group
  406. X.IR daemon .
  407. This insures control and data files are not readable or modifiable by a
  408. and ordinary user and that no ordinary user can remove files except through
  409. X.IR lprm .
  410. X.IP 4). 4
  411. XEach spool queue has a
  412. X.I lock
  413. file which controls queueing and printing.
  414. If the
  415. X.I lock
  416. has
  417. X.I "owner execute"
  418. permission set then unspooling is disabled;
  419. if it has
  420. X.I "group execute"
  421. permissions set then spooling is disabled;
  422. if it has
  423. X.I "other execute"
  424. permissions set then the spool queue should be reordered for
  425. unspooling purposes.
  426. X.IP 5). 4
  427. Prevention of multiple instances of a spool queue server is done by
  428. using the
  429. X.IR flock (2),
  430. or
  431. X.IR lockf (3)
  432. facility.
  433. When a server starts,
  434. it will try and lock the
  435. X.I lock
  436. file using
  437. X.IR flock ;
  438. if the lock fails then another server is active.
  439. X.IP 6). 4
  440. The active server process records its
  441. X.I "process id"
  442. and the name of the control file being processed in the
  443. X.I lock
  444. file.
  445. This information is used by
  446. X.I lpq
  447. to report the queue activity.
  448. X.IP 7). 4
  449. Before processing a job,
  450. the server process will lock the job's control file.
  451. This prevents multiple PLP programs such as 
  452. X.I lprm
  453. and
  454. X.I lpd
  455. from operating on the same job simultaneously.
  456. X.IP 8). 4
  457. If there are multiple servers for a single queue,
  458. the spool queue lock file is used to control spool activities,
  459. and individual printer server lock files are used to control the printers.
  460. X.IP 9). 4
  461. XEach spool queue 
  462. X.I status
  463. file which is used to record the current status of the server process.
  464. This information is displayed by
  465. X.I lpq
  466. and
  467. X.IR lpc .
  468. X.IP 10). 4
  469. A server process is setuid
  470. X.I root
  471. and its process group its
  472. X.I process
  473. id.
  474. Any subprocesses that it forks will be in the same process group.
  475. The
  476. X.I lprm
  477. program uses 
  478. X.IR killpg \|(2)
  479. to signal an active server process.
  480. The
  481. X.I killpg
  482. will effect the subprocess as well as the original server process.
  483. END_OF_FILE
  484. if test 2930 -ne `wc -c <'doc/PLP/03.t'`; then
  485.     echo shar: \"'doc/PLP/03.t'\" unpacked with wrong size!
  486. fi
  487. # end of 'doc/PLP/03.t'
  488. fi
  489. if test -f 'doc/PLP/10.t' -a "${1}" != "-c" ; then 
  490.   echo shar: Will not clobber existing file \"'doc/PLP/10.t'\"
  491. else
  492. echo shar: Extracting \"'doc/PLP/10.t'\" \(3248 characters\)
  493. sed "s/^X//" >'doc/PLP/10.t' <<'END_OF_FILE'
  494. X.ig
  495. X$Header: 10.t,v 1.1 88/05/21 18:39:51 papowell Locked $
  496. X$log$
  497. X..
  498. X.NH 1
  499. Troubleshooting
  500. X.PP
  501. The diagnostic messages issued by the PLP software
  502. are verbose to the point of being obnoxious.
  503. Usually there is enough information available to determine the exact cause
  504. of problems.
  505. However,
  506. there are times when a bit of explanations do help.
  507. X.PP
  508. In order to get detailed diagnostic information from any of the
  509. PLP software,
  510. you can enable diagnostic messages using the
  511. X.B -Dn
  512. option to set debugging to level
  513. X.IR n .
  514. Level 0 disables diagnostics,
  515. level 3 is chatty,
  516. level 5 is pretty verbose,
  517. and level 9 is absolutely everthing.
  518. X.NH 2
  519. LPD
  520. X.PP
  521. When lpd is started,
  522. it will try and open a log file.
  523. If it cannot,
  524. it will log to /dev/null.
  525. However,
  526. important errors are logged using the
  527. X.IR syslog (8)
  528. facility.
  529. You can specify a log file using the
  530. X.B "-L filename"
  531. option to lpd;
  532. X.B "-L -"
  533. will cause it to log error messages to standard output.
  534. X.PP
  535. XEach spool queue has an associated log file as well,
  536. as does each server for a spool queue.
  537. Most of the PLP software will also use
  538. X.IR syslog (8)
  539. for important messages,
  540. or log them to
  541. X.L /dev/console
  542. if syslog is not available.
  543. X.NH 2
  544. LPR
  545. X.SH
  546. lpr: \fIprinter\fP\|: unknown printer
  547. X.IP
  548. The
  549. X.I printer
  550. was not found in the
  551. X.I printcap
  552. database.
  553. Usually this is a typing mistake;
  554. however,
  555. it may indicate a missing or incorrect entry in the printcap file.
  556. X.SH
  557. lpr: \fIprinter\fP\|: jobs queued, but cannot start server.
  558. X.IP
  559. The connection to 
  560. X.I lpd
  561. on the local machine failed. 
  562. This usually means the lpd process started at
  563. boot time has died or is hung.
  564. Use the
  565. X.L "lpc lpd"
  566. command to check that the
  567. X.I lpd
  568. process is running.
  569. If it appears to be absent or not responding,
  570. you restart the lpd process using the following commands.
  571. X.DS
  572. X.L
  573. X.SM
  574. X% /usr/lib/lpd
  575. X.DE
  576. X.NH 2
  577. LPQ
  578. X.SH
  579. waiting for \fIprinter\fP to become ready (trying since ????)
  580. X.IP
  581. The printer device could not be opened by the server. 
  582. This can happen for a number of reasons,
  583. the most common being that the printer is turned off-line.
  584. This message can also be generated if the printer is out
  585. of paper, the paper is jammed, etc.
  586. The actual reason is dependent on the meaning
  587. of error codes returned by system device driver. 
  588. Not all printers supply sufficient information 
  589. to distinguish when a printer is off-line or having
  590. trouble (e.g. a printer connected through a serial line). 
  591. Another possible cause of this message is
  592. some other process, such as an output filter,
  593. has an exclusive open on the device.  Your only recourse
  594. here is to kill off the offending program(s) and
  595. restart the printer with
  596. X.IR lpc .
  597. X.SH
  598. connecting to <host> (trying since ????)
  599. X.IP
  600. The server is trying to connect to the remote site and nothing has happened.
  601. XFirst indication that the network is dead,
  602. or the host you are trying to reach is down.
  603. If the remote host is up,
  604. X.I lpd
  605. on the remote machine is probably dead or
  606. hung and should be restarted.
  607. X.SH
  608. warning: no server present
  609. X.IP
  610. There are entries in the spool queue,
  611. but no server exists.
  612. This normally occurs only when the server has unexpectedly died.
  613. The error log file for the spool queue should be checked for a
  614. diagnostic from the deceased process.
  615. Use the lpc restart command to start a server.
  616. END_OF_FILE
  617. if test 3248 -ne `wc -c <'doc/PLP/10.t'`; then
  618.     echo shar: \"'doc/PLP/10.t'\" unpacked with wrong size!
  619. fi
  620. # end of 'doc/PLP/10.t'
  621. fi
  622. if test -f 'doc/PLP/12.t' -a "${1}" != "-c" ; then 
  623.   echo shar: Will not clobber existing file \"'doc/PLP/12.t'\"
  624. else
  625. echo shar: Extracting \"'doc/PLP/12.t'\" \(2119 characters\)
  626. sed "s/^X//" >'doc/PLP/12.t' <<'END_OF_FILE'
  627. X.ig
  628. X$Header: 12.t,v 1.1 88/05/21 18:39:54 papowell Locked $
  629. X$log$
  630. X..
  631. X.bp
  632. X.NH 1
  633. Changes and Modifications
  634. X.PP
  635. This is a summary of the major differences between
  636. the new Line Printer Spooler and older Berkeley editions.
  637. X.NH 2
  638. Access Permissions
  639. X.PP
  640. All access is done using the printer_perms file.
  641. This checks for both remote hosts and users on remote hosts.
  642. Access permissions are divided in Control and Printing.
  643. Remote users with control permissions on a queue can do just about
  644. anything to the queue.
  645. XEliminates the need for ROOT to do all the queue management.
  646. X.NH 2
  647. Printcap Extensions
  648. X.PP
  649. The
  650. X.B fx
  651. X(format check)
  652. string allows a site to do checking to see if formats
  653. are allowed on a printer. This can be specially useful for remote printers
  654. by restricting certain certain formats.
  655. X.NH 2
  656. Prefilters
  657. X.PP
  658. This allows a local site to preprocess all the files at the local site,
  659. and produce a single spool file for later use.
  660. This is handy when using a remote printer.
  661. As a special case,
  662. the \-p option of LPR is processed at the local site.
  663. X.NH 2
  664. XFilter Parameters
  665. X.PP
  666. The filter parameters have been rationalized into a single set.
  667. All options now have the form
  668. X.IR -Fvalue ,
  669. making life a little easier for the filter writer.
  670. Also, additional paramters
  671. X.L "\-Jjobname" ,
  672. X.L "\-Cclass" ,
  673. X.L "\-Fformat" ,
  674. X.L "\-Zzopts" ,
  675. etc,
  676. are passed to filters.
  677. X.NH 2
  678. LPQ Information
  679. X.PP
  680. Greatly enhanced information.
  681. The time a job has started has been added to the status information.
  682. This is rather useful to know.
  683. X.NH 2
  684. XFilter Timeouts
  685. X.PP
  686. A timeout facility has been added to some filters.
  687. This helps when attempting to find out if a device has gone off
  688. line, is out of paper, etc.
  689. X.NH 2
  690. Special Queue Handling
  691. X.PP
  692. The
  693. X.B qh
  694. X(queue handler)
  695. entry in the printcap now allows specification of a handler
  696. to be invoked for every job taken from the queue.
  697. This is nice for systems which wish to use the spooler
  698. facilities for handling jobs,
  699. but not for doing the actual data transfer.
  700. X.NH 2
  701. Accounting
  702. X.PP
  703. Accounting information was reformatted,
  704. to make it a little easier for other programs like
  705. X.I awk
  706. and
  707. X.I sort
  708. to be used.
  709. END_OF_FILE
  710. if test 2119 -ne `wc -c <'doc/PLP/12.t'`; then
  711.     echo shar: \"'doc/PLP/12.t'\" unpacked with wrong size!
  712. fi
  713. # end of 'doc/PLP/12.t'
  714. fi
  715. if test -f 'doc/PLP/announce' -a "${1}" != "-c" ; then 
  716.   echo shar: Will not clobber existing file \"'doc/PLP/announce'\"
  717. else
  718. echo shar: Extracting \"'doc/PLP/announce'\" \(2490 characters\)
  719. sed "s/^X//" >'doc/PLP/announce' <<'END_OF_FILE'
  720. X.ig
  721. X$Header: 00.t,v 1.1 88/05/21 18:39:29 papowell Locked $
  722. X$log$
  723. X..
  724. X.RP
  725. X.EH 'PLP-%''PLP Manual'
  726. X.OH 'PLP Manual''PLP-%'
  727. X.nr CW 2.85i
  728. X.nr GW .3i
  729. X.TL
  730. PLP \- The Public Line Printer Spooler
  731. X.br
  732. A Portable UNIX Line Printer Spooler
  733. X.br
  734. Release 2.0, 1 June 1988
  735. X.AU
  736. Prof. Patrick Powell
  737. X.AI
  738. Dept. of Computer Science
  739. University of Minnesota, Minneapolis, Minnesota
  740. X.PP
  741. X.FS
  742. X* UNIX is a trademark of ATT Bell Laboratories.
  743. X.FE
  744. X.PP
  745. PLP is a reverse engineered version of the Berkeley LPD software.
  746. The functional resemblance between PLP and the
  747. Berkeley Line Printer Spooler (LPD) is intentional;
  748. the source code was written without reference to the
  749. original Berkeley LPD software,
  750. except for some very small sections concerned with networking and the
  751. large characters used for banner printing.
  752. The PLP software has the following features:
  753. X.IP 1). 5
  754. The PLP software is intended to be  used in a Networked File System
  755. X(NFS) environment,
  756. in which there is a common set of spool queues,
  757. as well as in a loosely coupled environment in which each host
  758. transfers print jobs to a host which has the printer.
  759. X.IP 2). 5
  760. Access and permission to use
  761. PLP functions is controlled by entries in a printer permissions file
  762. X.I (/usr/spool/lpd/printer_perms.<hostname>)
  763. which can restrict use by user name,
  764. host,
  765. spooler,
  766. page useage,
  767. and a host of other factors.
  768. The printcap file
  769. X.I (/usr/spool/lpd/printcap.<hostname>)
  770. is used to specify the printer queues and their operation.
  771. X.IP 3). 5
  772. Jobs can now be prioritized.
  773. The maximum priority a user can specify is set in the
  774. printer permissions file.
  775. X.IP 4). 5
  776. In addition to the general printer permissions file,
  777. each spool queue can have its own addition printer permissions file.
  778. X.IP 5). 5
  779. Line printer control functions can be exercised from a remote host.
  780. Hosts and users with 
  781. X.I "remote control permission"
  782. are specified by entries in the printer permissions file.
  783. X.IP 6). 5
  784. Unspooling of jobs can be performed by a printcap specified program,
  785. rather than by the PLP unspooler.
  786. This allows PLP to be used as a spooler
  787. and to have spool queues used for various purposes.
  788. X.IP 7). 5
  789. XExtremely verbose and chatty error messages have been added.
  790. These greatly ease debugging and installation.
  791. In addition,
  792. the
  793. X.I checkpc
  794. utility can be used to set file permissions and other items for
  795. use by the PLP software.
  796. X.IP 8). 5
  797. The code is quite portable,
  798. with as few system dependencies in it as possible.
  799. It has run on a VAX 4.2, 4.3, and ULTRIX,
  800. SUN 3.0,
  801. and
  802. DG-UX.
  803. END_OF_FILE
  804. if test 2490 -ne `wc -c <'doc/PLP/announce'`; then
  805.     echo shar: \"'doc/PLP/announce'\" unpacked with wrong size!
  806. fi
  807. # end of 'doc/PLP/announce'
  808. fi
  809. if test -f 'filters/compat.c' -a "${1}" != "-c" ; then 
  810.   echo shar: Will not clobber existing file \"'filters/compat.c'\"
  811. else
  812. echo shar: Extracting \"'filters/compat.c'\" \(2688 characters\)
  813. sed "s/^X//" >'filters/compat.c' <<'END_OF_FILE'
  814. X/*
  815. X * COMPAT: a selected set of parameters are passed to the specified file
  816. X * in order to be compatible.  This filter is called with the regular
  817. X * parameters, but will only pass the specified subset.
  818. X * Compat is called with:
  819. X * ..../compat /.../filter [usual options]
  820. X *  OF: filter      -wwidth -llength
  821. X *  IF: filter [-c] -wwidth -llength -iindent -n login -h host accounting_file
  822. X *  ?F: filter      -xwidth -ylength          -n login -h host accounting_file
  823. X */
  824. X
  825. X#include <stdio.h>
  826. extern errno;
  827. char *width, *length, *xwidth, *ylength, *indent, *login, *host, *af, *cflag;
  828. char *debug;
  829. int format;
  830. char *file;
  831. char *newvec[20];
  832. X
  833. main( argc, argv )
  834. X    int argc;
  835. X    char **argv;
  836. X{
  837. X    int i;
  838. X    char *arg;
  839. X
  840. X    newvec[0] = argv[1];
  841. X    for( i = 2; i < argc; ++i ){
  842. X        arg = argv[i];
  843. X        if( arg[0] == '-' ){
  844. X            switch( arg[1] ){
  845. X            case 'w': width = arg; break;
  846. X            case 'l': length = arg; break;
  847. X            case 'x': xwidth = arg; break;
  848. X            case 'y': ylength = arg; break;
  849. X            case 'i': indent = arg; break;
  850. X            case 'c': cflag = arg; break;
  851. X            case 'F': format = arg[2]; break;
  852. X            case 'h': host = arg+2; break;
  853. X            case 'n': login = arg+2; break;
  854. X            case 'D': debug = arg+2; break;
  855. X            }
  856. X        } else {
  857. X            af = arg;
  858. X        }
  859. X    }
  860. X    switch( format ){
  861. X    /*
  862. X     *  OF: filter      -wwidth -llength
  863. X     */
  864. X    case 'o':
  865. X        if( width == 0 || length == 0 ){
  866. X            fprintf( stderr, "%s: OF- missing one of -w, -l\n", argv[0] );
  867. X            exit( 2 );
  868. X        }
  869. X        i = 1;
  870. X        newvec[i++] = width;
  871. X        newvec[i++] = length;
  872. X        break;
  873. X    /*
  874. X     *  IF: filter [-c] -wwidth -llength -iindent -n login -h host af
  875. X     */
  876. X    case 'i':
  877. X        if( width == 0 || length == 0
  878. X            || login == 0 || host == 0 ){
  879. X            fprintf(stderr,"%s: IF- missing one of -w, -l, -n, -h\n",argv[0]);
  880. X            exit( 2 );
  881. X        }
  882. X        if( indent == 0 ){
  883. X            indent = "-i0";
  884. X        }
  885. X        i = 1;
  886. X        if( cflag ){
  887. X            newvec[i++] = cflag;
  888. X        }
  889. X        newvec[i++] = width;
  890. X        newvec[i++] = length;
  891. X        newvec[i++] = indent;
  892. X        newvec[i++] = "-n";
  893. X        newvec[i++] = login;
  894. X        newvec[i++] = "-h";
  895. X        newvec[i++] = host;
  896. X        newvec[i++] = af;
  897. X        break;
  898. X    /*
  899. X     *  ?F: filter      -xwidth -ylength          -n login -h host af
  900. X     */
  901. X    default:
  902. X        if( xwidth == 0 || ylength == 0
  903. X            || login == 0 || host == 0 ){
  904. X            fprintf(stderr,"%s: %cF- missing one of -x, -y, -n, -h\n", argv[0],
  905. X                format);
  906. X            exit( 2 );
  907. X        }
  908. X        i = 1;
  909. X        newvec[i++] = xwidth;
  910. X        newvec[i++] = ylength;
  911. X        newvec[i++] = "-n";
  912. X        newvec[i++] = login;
  913. X        newvec[i++] = "-h";
  914. X        newvec[i++] = host;
  915. X        newvec[i++] = af;
  916. X        break;
  917. X    }
  918. X    if( debug ){
  919. X        for(i = 0; newvec[i]; ++i ){
  920. X            fprintf(stderr, "%s ", newvec[i] );
  921. X        }
  922. X        putc( '\n', stderr );
  923. X        fflush(stderr);
  924. X    }
  925. X    execv( newvec[0], newvec );
  926. X    i = errno;
  927. X    fprintf( stderr, "%s: execv failed (errno %d)", argv[0], errno);
  928. X    errno = i;
  929. X    perror( " " );
  930. X}
  931. END_OF_FILE
  932. if test 2688 -ne `wc -c <'filters/compat.c'`; then
  933.     echo shar: \"'filters/compat.c'\" unpacked with wrong size!
  934. fi
  935. # end of 'filters/compat.c'
  936. fi
  937. if test -f 'man/checkpc.1' -a "${1}" != "-c" ; then 
  938.   echo shar: Will not clobber existing file \"'man/checkpc.1'\"
  939. else
  940. echo shar: Extracting \"'man/checkpc.1'\" \(1987 characters\)
  941. sed "s/^X//" >'man/checkpc.1' <<'END_OF_FILE'
  942. X.TH CHECKPC 1 "19 Mar 1988" "U-MN PLP"
  943. X.ig
  944. X$Header: checkpc.1,v 2.1 88/05/09 10:08:23 papowell Exp $
  945. X$Log:    checkpc.1,v $
  946. Revision 2.1  88/05/09  10:08:23  papowell
  947. PLP: Released Version
  948. X
  949. Revision 1.1  88/04/28  10:58:47  papowell
  950. Initial revision
  951. X
  952. X..
  953. X.SH NAME
  954. checkpc \- check out the /etc/printcap database
  955. X.SH SYNOPSIS
  956. X.B checkpc
  957. X[
  958. X.B \-f
  959. X] [
  960. X.B \-l
  961. X] [
  962. X.B \-o
  963. X] [
  964. X.B \-a
  965. X] [
  966. printcap
  967. X]
  968. X.SH DESCRIPTION
  969. X.B Checkpc
  970. is used to check for the existence and correct permissions of entries
  971. in the
  972. X.I printcap
  973. database,
  974. which defaults to /etc/printcap.
  975. It is useful when installing a new printcap database.
  976. X.IP "\fB\-f\fI" 5
  977. The fix flag will cause the checkpc program to try and fix
  978. various files and permissions.
  979. It does this in a simple minded manner,
  980. and the program may have to be run several times until all permissions
  981. are correct.
  982. X.IP "\fB\-l\fI" 5
  983. Do not create log files if the fix option has been specified.
  984. X.IP "\fB\-o\fI" 5
  985. Create printer (lp) if the fix option has been specified;
  986. default is not to create printer.
  987. X.IP "\fB\-a\fI" 5
  988. Do not create accounting files if the fix option has been specified.
  989. X.SH "ANNOYING FEATURES"
  990. If the
  991. X.B \-f
  992. X(fix)
  993. option is specified and you do not run this as root,
  994. it will complain,
  995. but attempt to carry out the operations.
  996. Usually the 
  997. X.IR chown (5)
  998. will fail,
  999. but this is not serious.
  1000. If you are installing a test version of the PLP software,
  1001. do NOT run as root,
  1002. otherwise files will be owned by daemon and not accessible.
  1003. X.SH FILES
  1004. X.nf
  1005. X.ta \w'/usr/spool/*/cf*       'u
  1006. X/etc/printcap    printer capabilities data base
  1007. X/tmp/printcap    use this is -X is specified
  1008. X/usr/spool/*    directories used for spooling
  1009. X.fi
  1010. X.SH "SEE ALSO"
  1011. lpq(1),
  1012. lprm(1),
  1013. pr(1),
  1014. printcap(5),
  1015. lpc(8),
  1016. lpd(8),
  1017. X.br
  1018. X.I "PLP- The Public Line Printer Spooler" ,
  1019. Patrick Powell,
  1020. U. Minnesota.
  1021. X.fi
  1022. X.SH DIAGNOSTICS
  1023. Tons of them.
  1024. XExcrutiatingly verbose.
  1025. X.SH BUGS
  1026. Should fix things up in a single pass,
  1027. but I got lazy.
  1028. X.SH "AUTHOR"
  1029. Patrick Powell, U. Minnesota, Dept. of Computer Science.
  1030. END_OF_FILE
  1031. if test 1987 -ne `wc -c <'man/checkpc.1'`; then
  1032.     echo shar: \"'man/checkpc.1'\" unpacked with wrong size!
  1033. fi
  1034. # end of 'man/checkpc.1'
  1035. fi
  1036. if test -f 'man/pac.8' -a "${1}" != "-c" ; then 
  1037.   echo shar: Will not clobber existing file \"'man/pac.8'\"
  1038. else
  1039. echo shar: Extracting \"'man/pac.8'\" \(2392 characters\)
  1040. sed "s/^X//" >'man/pac.8' <<'END_OF_FILE'
  1041. X.TH PAC 8 "19 Mar 1988" "U-MN PLP"
  1042. X.ig
  1043. X$Header: pac.8,v 2.1 88/05/09 10:08:49 papowell Exp $
  1044. X$Log:    pac.8,v $
  1045. Revision 2.1  88/05/09  10:08:49  papowell
  1046. PLP: Released Version
  1047. X
  1048. Revision 1.1  88/04/28  10:58:56  papowell
  1049. Initial revision
  1050. X
  1051. X..
  1052. X.SH NAME
  1053. pac \- printer/ploter accounting information
  1054. X.SH SYNOPSIS
  1055. X.B /etc/pac
  1056. X[
  1057. X.B \-Pprinter
  1058. X] [
  1059. X.B \-pprice
  1060. X] [
  1061. X.B \-a
  1062. X] [
  1063. X.B \-e
  1064. X] [
  1065. X.B \-s
  1066. X]
  1067. X.SH DESCRIPTION
  1068. X.I Pac
  1069. reads the printer/plotter accounting files, accumulating the number
  1070. of pages (the usual case) or feet (for raster devices)
  1071. of paper consumed by each user, and printing out
  1072. how much each user consumed in pages or feet and dollars.
  1073. X.IP \fB\-P\fIprinter\fR
  1074. Selects the printer.
  1075. If not specified,
  1076. the value of the environment variable
  1077. X.B PRINTER
  1078. is used,
  1079. and if it is not defined,
  1080. the default printer for the site.
  1081. X.IP \fB-p\fIprice\fP
  1082. The price per page to be used,
  1083. instead of the printcap
  1084. X.B co
  1085. X(cost) entry.
  1086. If none is specified,
  1087. the default price of $0.02 per page is used.
  1088. X.IP \fB\-a\fR
  1089. Accounting is done for all printers.
  1090. A cumulative summary of usage of all the entries will be printed.
  1091. X.IP \fB\-e\fR
  1092. Accounting is done for each printer entry in turn.
  1093. X.IP \fP\-s\fR
  1094. Summarize the accounting information in the summary accounting file.
  1095. Used with the
  1096. X.B \-a
  1097. or
  1098. X.B \-e
  1099. flag all the accounting information for each printer
  1100. can be done at once.
  1101. This option has the side effect of truncating the original file.
  1102. It copies the original file to a backup before
  1103. doing any action.
  1104. X.PP
  1105. The accounting file is specified in the printcap
  1106. X.B af
  1107. entry.
  1108. The summary accounting file has the
  1109. X.B .sum
  1110. suffix added.
  1111. X.SH FILES
  1112. X.ta 2i
  1113. printcap af entry
  1114. X.SH NOTES
  1115. The accounting information is generated by the various filters used by
  1116. the
  1117. X.I LPD
  1118. daemon.
  1119. XFor each user file they should write a line to the accounting file in the
  1120. following format.
  1121. X.RS
  1122. X.nf
  1123. user host pages format date
  1124. papowell umn-cs 10 C April 13 1988
  1125. X.RE
  1126. X.PP
  1127. The summary file will produce entries of the form:
  1128. X.RS
  1129. X.nf
  1130. user host pages format runs cost
  1131. papowell umn-cs 1320 17 32.00
  1132. X.RE
  1133. X.SH "SEE ALSO"
  1134. X.br
  1135. X.I "PLP - The Public Line Printer Spooler",
  1136. by
  1137. Patrick Powell,
  1138. University of Minnesota.
  1139. X.fi
  1140. X.SH "HISTORY"
  1141. X.PP
  1142. The PLP is a reverse engineered version of the Berkeley 4.3BSD Line Printer
  1143. Spooler.
  1144. It has many advanced features which are described in
  1145. X.I "PLP - The Public Line Printer Spooler"
  1146. by
  1147. Patrick Powell,
  1148. University of Minnesota.
  1149. END_OF_FILE
  1150. if test 2392 -ne `wc -c <'man/pac.8'`; then
  1151.     echo shar: \"'man/pac.8'\" unpacked with wrong size!
  1152. fi
  1153. # end of 'man/pac.8'
  1154. fi
  1155. if test -f 'man/printer.1' -a "${1}" != "-c" ; then 
  1156.   echo shar: Will not clobber existing file \"'man/printer.1'\"
  1157. else
  1158. echo shar: Extracting \"'man/printer.1'\" \(2039 characters\)
  1159. sed "s/^X//" >'man/printer.1' <<'END_OF_FILE'
  1160. X.TH PRINTER 1 "19 Mar 1988" "U-MN PLP"
  1161. X.ig
  1162. X$Header: printer.1,v 2.2 88/05/20 23:26:34 papowell Locked $
  1163. X$Log:    printer.1,v $
  1164. Revision 2.2  88/05/20  23:26:34  papowell
  1165. Removed redundant information
  1166. X
  1167. Revision 2.1  88/05/09  10:08:58  papowell
  1168. PLP: Released Version
  1169. X
  1170. Revision 1.1  88/04/28  10:58:59  papowell
  1171. Initial revision
  1172. X
  1173. X..
  1174. X.SH NAME
  1175. Printer \- printers used in typesetting.
  1176. X.SH DESCRIPTION
  1177. Typeset material prepared with the interface to
  1178. X.IR troff (1)
  1179. provided by the
  1180. X.IR typeset (1)
  1181. command can be sent to these supported printer types:
  1182. X.PP
  1183. X.ta 5n +\w'\fIpostscript\fP   'u
  1184. X.nf
  1185. X    \fIdumb\fP    line printer, DevWriter, crt etc.
  1186. X    \fIversatec\fP    versatec V80, or Printronix printer
  1187. X    \fIimagen300\fP    medium quality laser printer
  1188. X    \fIpostscript\fP    the PostScript language
  1189. X.fi
  1190. X.PP
  1191. The Printronix printer emulates a 300-dots-per-inch Versatec printer using 
  1192. X180 dots per inch, giving a blown-up page image;
  1193. the usual 8.5 by 11.0 inch wide page will be printed as a 15 by 18 inch page.
  1194. It uses an impact matrix print head to produce images on the paper and can
  1195. print any output meant for the Imagen.
  1196. The Versatec is a raster based output device, and can be used for high
  1197. quality VLSI design plots.
  1198. X.PP
  1199. The imagen300 (300 dots/inch resolution) uses a dry toner thereby producing
  1200. a square sharp pixel(dot).
  1201. This produces clear aliasing in some glyph definitions.  There is no blurring
  1202. of characters and output definition is constant across the whole page.
  1203. X.PP
  1204. PostScript is a resolution independent page description language.
  1205. The most common printer at Minnesota is the Apple LaserWriter (300 dots/inch).
  1206. X.SH COST
  1207. All typesetting has a processing cost(overhead).
  1208. The cost per page of output varies depending on what device you are using.
  1209. Page quotas and other methods can be used to keep track of individual use,
  1210. and appropriate billing can be done.
  1211. X.SH AVAILABILITY
  1212. Most printers are available to all Unix systems on campus.  Please
  1213. consult
  1214. X.IR printers (1)
  1215. for the availability of printers on your particular machine.
  1216. X.SH "SEE ALSO"
  1217. printers(1)
  1218. END_OF_FILE
  1219. if test 2039 -ne `wc -c <'man/printer.1'`; then
  1220.     echo shar: \"'man/printer.1'\" unpacked with wrong size!
  1221. fi
  1222. # end of 'man/printer.1'
  1223. fi
  1224. if test -f 'man/printers.1' -a "${1}" != "-c" ; then 
  1225.   echo shar: Will not clobber existing file \"'man/printers.1'\"
  1226. else
  1227. echo shar: Extracting \"'man/printers.1'\" \(2212 characters\)
  1228. sed "s/^X//" >'man/printers.1' <<'END_OF_FILE'
  1229. X.TH PRINTERS 1 "19 Mar 1988" "U-MN PLP"
  1230. X.ig
  1231. X$Header: printers.1,v 2.2 88/05/20 23:26:49 papowell Locked $
  1232. X$Log:    printers.1,v $
  1233. Revision 2.2  88/05/20  23:26:49  papowell
  1234. Removed redundant information
  1235. X
  1236. Revision 2.1  88/05/09  10:09:01  papowell
  1237. PLP: Released Version
  1238. X
  1239. Revision 1.1  88/04/28  10:59:01  papowell
  1240. Initial revision
  1241. X
  1242. X..
  1243. X.SH NAME
  1244. printers \- as used in the -Pxxx option in lpr(1), lpq(1), and lprm(1).
  1245. X.SH "THE REAL PRINTERS"
  1246. The command "lpc stat" will show you the printers on the machine
  1247. you are using,
  1248. as well as whether they are able to accept data for printing.
  1249. The following summarizes the printers available on various machines.
  1250. X.br
  1251. X------ Site Dependent Information -------------
  1252. X.br
  1253. X.LP
  1254. X.I <printerType>_<printerLocation>
  1255. is the format used in naming printers.
  1256. X.LP
  1257. X.TP 1.8i
  1258. X.B imagen
  1259. Imagen 8/300 laser printer in Lind 33.
  1260. X.br
  1261. X\fIAlternate names\fR: csi, i300
  1262. X.SH GENERIC PRINTER NAMES
  1263. Most sites have generic names for printers of various types which can be
  1264. used to refer to a convinient real printer of the same type.
  1265. This mapping is host specific and is given in the CONFIGURATION section below.
  1266. X.br
  1267. X.TP 1i
  1268. X.B lp
  1269. This is the default line printer for the commands
  1270. X.I lpr(1), lpq(1), and lprm(1)
  1271. when no printer is specified via the -Pxxx option.
  1272. X.TP
  1273. X.B imagen
  1274. The default Imagen 8/300 compatible laser printer.
  1275. X.TP
  1276. X.B printronix
  1277. The default Printronix type printer able to emulate a versatec.
  1278. X.TP
  1279. X.B versatec
  1280. The default Versatec type printer that can accept raster images.
  1281. X.br
  1282. Note that at some sites this is emulated by a Printronix.
  1283. X.SH CONFIGURATION
  1284. XFor each site, the printers corresponding to the generic names
  1285. X.I
  1286. lp, printronix, imagen,
  1287. X.R
  1288. and
  1289. X.I versatec
  1290. X.R
  1291. are given in parentheses.
  1292. X.tr ~ 
  1293. X.ta 2.25i 3.25i
  1294. X.TP 1i
  1295. X.B umn-cs
  1296. X.IR imagen ~(imagen_cs), "    ~lp" ~(??),
  1297. X.SH FILES
  1298. X.br
  1299. X.nf
  1300. X/etc/printcap
  1301. X.fi
  1302. X.SH SEE ALSO
  1303. lpr(1),
  1304. lprm(1),
  1305. lpq(1),
  1306. lpc(8),
  1307. printcap(8).
  1308. X.br
  1309. X.SH "HISTORY"
  1310. X.PP
  1311. The PLP is a reverse engineered version of the Berkeley 4.3BSD Line Printer
  1312. Spooler,
  1313. done in 1988 at the University of Minnesota.
  1314. It has many advanced features which are described in
  1315. X.I "PLP - The Public Line Printer Spooler"
  1316. by
  1317. Patrick Powell,
  1318. Department of Computer Science,
  1319. University of Minnesota.
  1320. END_OF_FILE
  1321. if test 2212 -ne `wc -c <'man/printers.1'`; then
  1322.     echo shar: \"'man/printers.1'\" unpacked with wrong size!
  1323. fi
  1324. # end of 'man/printers.1'
  1325. fi
  1326. if test -f 'src/find_name.c' -a "${1}" != "-c" ; then 
  1327.   echo shar: Will not clobber existing file \"'src/find_name.c'\"
  1328. else
  1329. echo shar: Extracting \"'src/find_name.c'\" \(2848 characters\)
  1330. sed "s/^X//" >'src/find_name.c' <<'END_OF_FILE'
  1331. X/***************************************************************************
  1332. X * U. Minnesota LPD Software * Copyright 1987, 1988, Patrick Powell
  1333. X ***************************************************************************
  1334. X * MODULE: find_name.c
  1335. X * manages the Parms[] array entries.  Used by sender and receiver
  1336. X * file transfer functions of LPD.
  1337. X * The Parms[] array is maintained as a sorted list.
  1338. X * Find_name( char *name ): search the Parm[].filename entries for a match.
  1339. X *    returns: index if found, -1 if not;
  1340. X * Add_name( char *name ): search the Parm[].filename entries for a match.
  1341. X *    if not found, add the entry.
  1342. X *    returns: index where found or created.
  1343. X ***************************************************************************
  1344. X * Revision History: Created Sun Mar 13 10:29:54 CST 1988
  1345. X * $Log:    find_name.c,v $
  1346. X * Revision 3.1  88/06/18  09:34:11  papowell
  1347. X * Version 3.0- Distributed Sat Jun 18 1988
  1348. X * 
  1349. X * Revision 2.1  88/05/09  10:08:05  papowell
  1350. X * PLP: Released Version
  1351. X * 
  1352. X * Revision 1.2  88/04/26  15:52:47  papowell
  1353. X * Fixed up a horribly silly bug in the add_files and File_name
  1354. X * routines;  sigh.  Would you believe an L (l) and a one (1) got mixed
  1355. X * up?
  1356. X * 
  1357. X * Revision 1.1  88/03/25  14:59:28  papowell
  1358. X * Initial revision
  1359. X * 
  1360. X ***************************************************************************/
  1361. X#ifndef lint
  1362. static char id_str1[] =
  1363. X    "$Header: find_name.c,v 3.1 88/06/18 09:34:11 papowell Exp $ PLP Copyright 1988 Patrick Powell";
  1364. X#endif lint
  1365. X#include "lp.h"
  1366. X
  1367. X/***************************************************************************
  1368. X * Find_name( char *name)
  1369. X * The Parms[] array is used to hold the names of data and control files
  1370. X * corresponding to a job.  The Find_name will look through the list for
  1371. X * the job.
  1372. X ***************************************************************************/
  1373. X
  1374. XFind_name( name )
  1375. X    char *name;
  1376. X{
  1377. X    int i, j;
  1378. X
  1379. X    j = -1;
  1380. X    for( i = 0; i < Parmcount; ++i ){
  1381. X        if( strcmp( Parms[i].filename, name) == 0 ){
  1382. X            j = i;
  1383. X            break;
  1384. X        }
  1385. X    }
  1386. X    if(Debug>6)log(XLOG_DEBUG,"Find_name: %s, entry %d", name, j );
  1387. X    return( j );
  1388. X}
  1389. X
  1390. X/***************************************************************************
  1391. X * Add_name(char *name)
  1392. X * Maintains the Parms[].filename entries in sorted order.
  1393. X * 1. See if in file. if it is, return index.
  1394. X * 2. If not,  you will find the entry where it should be inserted.
  1395. X * 3. Move all the entries up one position.
  1396. X * the job.
  1397. X ***************************************************************************/
  1398. X
  1399. int
  1400. Add_name( name )
  1401. X    char *name;
  1402. X{
  1403. X    int i;
  1404. X
  1405. X    if( (i = Find_name( name )) < 0 ){
  1406. X        if( Parmcount < MAXPARMS ){
  1407. X            i = Parmcount;
  1408. X            ++Parmcount;
  1409. X            (void)bzero( (char *)&Parms[i], sizeof( struct parm ));
  1410. X            (void)strcpy(Parms[i].filename, name );
  1411. X        } else {
  1412. X            i = -1;
  1413. X        }
  1414. X    }
  1415. X    if(Debug>5)log(XLOG_DEBUG,"Add_name: %s, entry %d", name, i );
  1416. X    return( i );
  1417. X}
  1418. END_OF_FILE
  1419. if test 2848 -ne `wc -c <'src/find_name.c'`; then
  1420.     echo shar: \"'src/find_name.c'\" unpacked with wrong size!
  1421. fi
  1422. # end of 'src/find_name.c'
  1423. fi
  1424. if test -f 'src/getprinter.c' -a "${1}" != "-c" ; then 
  1425.   echo shar: Will not clobber existing file \"'src/getprinter.c'\"
  1426. else
  1427. echo shar: Extracting \"'src/getprinter.c'\" \(3319 characters\)
  1428. sed "s/^X//" >'src/getprinter.c' <<'END_OF_FILE'
  1429. X/***************************************************************************
  1430. X * U. Minnesota LPD Software * Copyright 1987, 1988, Patrick Powell
  1431. X ***************************************************************************
  1432. X * MODULE: get_printer.c
  1433. X * gets the default printer value for a user job
  1434. X ***************************************************************************
  1435. X * Revision History: Created Mon Feb  1 12:31:23 CST 1988
  1436. X * $Log:    getprinter.c,v $
  1437. X * Revision 3.1  88/06/18  09:34:15  papowell
  1438. X * Version 3.0- Distributed Sat Jun 18 1988
  1439. X * 
  1440. X * Revision 2.1  88/05/09  10:08:11  papowell
  1441. X * PLP: Released Version
  1442. X * 
  1443. X * Revision 1.4  88/05/05  20:07:09  papowell
  1444. X * Minor changes to shut up lint.
  1445. X * 
  1446. X * Revision 1.3  88/03/25  14:59:31  papowell
  1447. X * Debugged Version:
  1448. X * 1. Added the PLP control file first transfer
  1449. X * 2. Checks for MX during file transfers
  1450. X * 3. Found and fixed a mysterious bug involving the SYSLOG facilities;
  1451. X *     apparently they open files and then assume that they will stay
  1452. X *     open.
  1453. X * 4. Made sure that stdin, stdout, stderr was available at all times.
  1454. X * 
  1455. X * Revision 1.2  88/03/05  15:02:02  papowell
  1456. X * Minor Corrections,  Lint Problems
  1457. X * 
  1458. X * Revision 1.1  88/03/01  11:08:26  papowell
  1459. X * Initial revision
  1460. X * 
  1461. X ***************************************************************************/
  1462. X#ifndef lint
  1463. static char id_str1[] =
  1464. X    "$Header: getprinter.c,v 3.1 88/06/18 09:34:15 papowell Exp $ PLP Copyright 1988 Patrick Powell";
  1465. X#endif lint
  1466. X
  1467. X#include "lp.h"
  1468. X/***************************************************************************
  1469. X * Get_Printer()
  1470. X * Get the Printer Name
  1471. X * 1. check for -P option
  1472. X * 2. check for PRINTER environment variable
  1473. X * 3. use first in printcap
  1474. X *
  1475. X ***************************************************************************/
  1476. Get_Printer(all)
  1477. X    int all;
  1478. X{
  1479. X    int i;
  1480. X
  1481. X    if( Printer == 0 ){
  1482. X        if( Printer = getenv( "PRINTER" ) ){
  1483. X            if(Debug>4)log(XLOG_DEBUG,
  1484. X                "Get_Printer: PRINTER environment var '%s'", Printer );
  1485. X        } else {
  1486. X            /* use the default, first in list */
  1487. X            Printer = First_printer();
  1488. X            if(Debug>4)log(XLOG_DEBUG,
  1489. X                "Get_Printer: First_printer '%s'", Printer );
  1490. X        }
  1491. X    }
  1492. X    if(Debug>4)log(XLOG_DEBUG,"Get_printer: using Printer %s",Printer);
  1493. X    if( all ){
  1494. X        i = Get_pc_entry(Printer, All_pc_vars, All_pc_len );
  1495. X    } else {
  1496. X        i = Get_pc_entry(Printer, Status_pc_vars, Status_pc_len );
  1497. X    }
  1498. X    if( i == 0 ){
  1499. X        Diemsg( "no printcap entry for printer %s", Printer );
  1500. X    }
  1501. X}
  1502. X
  1503. X/***************************************************************************
  1504. X * Diemsg( char *m1, *m2, ...)
  1505. X * print error message and die
  1506. X ***************************************************************************/
  1507. X/*VARARGS1*/
  1508. Diemsg(m1, m2, m3, m4, m5, m6)
  1509. X    char *m1;
  1510. X    int m2, m3, m4, m5, m6;
  1511. X{
  1512. X    (void)fprintf( stderr, "%s: Fatal error- ", Name );
  1513. X    (void)fprintf( stderr, m1, m2, m3, m4, m5, m6 );
  1514. X    (void)fprintf( stderr, "\n" );
  1515. X    cleanup();
  1516. X    exit(1);
  1517. X}
  1518. X/***************************************************************************
  1519. X * Warnmsg( char *m1, *m2, ...)
  1520. X * print warning message
  1521. X ***************************************************************************/
  1522. X/*VARARGS1*/
  1523. Warnmsg(m1, m2, m3, m4, m5, m6)
  1524. X    char *m1;
  1525. X    int m2, m3, m4, m5, m6;
  1526. X{
  1527. X    (void)fprintf( stderr, "%s: Warning- ", Name );
  1528. X    (void)fprintf( stderr, m1, m2, m3, m4, m5, m6 );
  1529. X    (void)fprintf( stderr, "\n" );
  1530. X}
  1531. END_OF_FILE
  1532. if test 3319 -ne `wc -c <'src/getprinter.c'`; then
  1533.     echo shar: \"'src/getprinter.c'\" unpacked with wrong size!
  1534. fi
  1535. # end of 'src/getprinter.c'
  1536. fi
  1537. if test -f 'src/lpr.h' -a "${1}" != "-c" ; then 
  1538.   echo shar: Will not clobber existing file \"'src/lpr.h'\"
  1539. else
  1540. echo shar: Extracting \"'src/lpr.h'\" \(2756 characters\)
  1541. sed "s/^X//" >'src/lpr.h' <<'END_OF_FILE'
  1542. X/***************************************************************************
  1543. X * U. Minnesota LPD Software * Copyright 1987, 1988, Patrick Powell
  1544. X ***************************************************************************
  1545. X * MODULE: lpr.h
  1546. X * Header file for LPR Program
  1547. X ***************************************************************************
  1548. X * $Header: lpr.h,v 3.1 88/06/18 09:34:49 papowell Exp $
  1549. X * Revision History: Created Sat Jan 30 19:39:13 CST 1988
  1550. X * $Log:    lpr.h,v $
  1551. X * Revision 3.1  88/06/18  09:34:49  papowell
  1552. X * Version 3.0- Distributed Sat Jun 18 1988
  1553. X * 
  1554. X * Revision 2.2  88/05/29  13:10:14  papowell
  1555. X * Added Header string for RCS purposes
  1556. X * 
  1557. X * Revision 2.1  88/05/09  10:10:55  papowell
  1558. X * PLP: Released Version
  1559. X * 
  1560. X * Revision 1.3  88/05/05  20:09:02  papowell
  1561. X * Added a NOHEADER option that allows user to suppress banner
  1562. X * 
  1563. X * Revision 1.2  88/03/25  15:00:20  papowell
  1564. X * Debugged Version:
  1565. X * 1. Added the PLP control file first transfer
  1566. X * 2. Checks for MX during file transfers
  1567. X * 3. Found and fixed a mysterious bug involving the SYSLOG facilities;
  1568. X *     apparently they open files and then assume that they will stay
  1569. X *     open.
  1570. X * 4. Made sure that stdin, stdout, stderr was available at all times.
  1571. X * 
  1572. X * Revision 1.1  88/03/01  12:44:04  papowell
  1573. X * Initial revision
  1574. X * 
  1575. X ***************************************************************************/
  1576. X#include "lp.h"
  1577. X
  1578. extern int Format;        /* Job Format */
  1579. extern int Copies;        /* Number of Copies */
  1580. extern int Binary;        /* Binary files */
  1581. extern int Use_links;    /* Make a symbolic link to the file */
  1582. extern int Remove;        /* Remove file after spooling */
  1583. extern int Noheader;    /* No header is to be printed */
  1584. extern char **Temp_file;    /* Names of temp files */
  1585. extern int Temp_count;    /* current number of temp files */
  1586. extern int Temp_max;    /* maximum number of temp files */
  1587. extern int Exper;        /* use the Xpert version */
  1588. extern int Priority;    /* priority */
  1589. extern int Job_number;    /* job sequence number */
  1590. extern char *Add_temp();    /* add a file to the temporary list */
  1591. extern char *Get_tmp_data();    /* create a temporary data file name */
  1592. extern char *Get_home();    /* get the home directory */
  1593. extern char *Get_cf();        /* create a temporary control file name */
  1594. extern char *Make_cf();        /* rename the temporary control file as real  */
  1595. extern char *Read_stdin;    /* name of temp file holding stdin */
  1596. extern int Open_SD();     /* Open the file in the spool directory */
  1597. extern char *Filter_out;    /* name of temp file for filter output */
  1598. extern char *Copy_file();    /* copy file to a temp file */
  1599. extern char *Get_cwd();        /* get the current working directory */
  1600. extern char *Full_path();    /* get the full path from the CWD */
  1601. extern int Do_prefilter();    /* do prefilter and return length */
  1602. END_OF_FILE
  1603. if test 2756 -ne `wc -c <'src/lpr.h'`; then
  1604.     echo shar: \"'src/lpr.h'\" unpacked with wrong size!
  1605. fi
  1606. # end of 'src/lpr.h'
  1607. fi
  1608. if test -f 'src/lpr_global.c' -a "${1}" != "-c" ; then 
  1609.   echo shar: Will not clobber existing file \"'src/lpr_global.c'\"
  1610. else
  1611. echo shar: Extracting \"'src/lpr_global.c'\" \(2069 characters\)
  1612. sed "s/^X//" >'src/lpr_global.c' <<'END_OF_FILE'
  1613. X/***************************************************************************
  1614. X * U. Minnesota LPD Software * Copyright 1987, 1988, Patrick Powell
  1615. X ***************************************************************************
  1616. X * MODULE: lpr_global.c
  1617. X * Globals for LPR Program
  1618. X ***************************************************************************
  1619. X * Revision History: Created Mon Jan 25 17:16:16 CST 1988
  1620. X * $Log:    lpr_global.c,v $
  1621. X * Revision 3.1  88/06/18  09:34:56  papowell
  1622. X * Version 3.0- Distributed Sat Jun 18 1988
  1623. X * 
  1624. X * Revision 2.1  88/05/09  10:09:16  papowell
  1625. X * PLP: Released Version
  1626. X * 
  1627. X * Revision 1.3  88/05/05  20:08:58  papowell
  1628. X * Added a NOHEADER option that allows user to suppress banner
  1629. X * 
  1630. X * Revision 1.2  88/03/25  15:00:32  papowell
  1631. X * Debugged Version:
  1632. X * 1. Added the PLP control file first transfer
  1633. X * 2. Checks for MX during file transfers
  1634. X * 3. Found and fixed a mysterious bug involving the SYSLOG facilities;
  1635. X *     apparently they open files and then assume that they will stay
  1636. X *     open.
  1637. X * 4. Made sure that stdin, stdout, stderr was available at all times.
  1638. X * 
  1639. X * Revision 1.1  88/03/01  11:08:47  papowell
  1640. X * Initial revision
  1641. X * 
  1642. X ***************************************************************************/
  1643. X#ifndef lint
  1644. static char id_str1[] =
  1645. X    "$Header: lpr_global.c,v 3.1 88/06/18 09:34:56 papowell Exp $ PLP Copyright 1988 Patrick Powell";
  1646. X#endif lint
  1647. X
  1648. X#include "lpr.h"
  1649. X
  1650. int Format;                    /* Job Format */
  1651. int Copies;                    /* Number of Copies */
  1652. int Binary;                    /* Binary files */
  1653. int Remove;                    /* Remove files after using */
  1654. int Use_links;                /* Make a symbolic link to the file */
  1655. char **Temp_file;            /* Names of temp files */
  1656. int Temp_count;                /* current number of temp files */
  1657. int Temp_max;                /* maximum number of temp files */
  1658. int Exper;                    /* use the Xpert version */
  1659. int Priority;                /* job priority */
  1660. int Job_number;                /* job sequence number */
  1661. char *Read_stdin;            /* name of temp file holding stdin */
  1662. char *Filter_out;            /* name of temp file for filter output */
  1663. int Noheader;                /* No header is to be printed */
  1664. END_OF_FILE
  1665. if test 2069 -ne `wc -c <'src/lpr_global.c'`; then
  1666.     echo shar: \"'src/lpr_global.c'\" unpacked with wrong size!
  1667. fi
  1668. # end of 'src/lpr_global.c'
  1669. fi
  1670. if test -f 'src/startserver.c' -a "${1}" != "-c" ; then 
  1671.   echo shar: Will not clobber existing file \"'src/startserver.c'\"
  1672. else
  1673. echo shar: Extracting \"'src/startserver.c'\" \(2442 characters\)
  1674. sed "s/^X//" >'src/startserver.c' <<'END_OF_FILE'
  1675. X/***************************************************************************
  1676. X * U. Minnesota LPD Software * Copyright 1987, 1988, Patrick Powell
  1677. X ***************************************************************************
  1678. X * MODULE: startserver.c
  1679. X * send a "start" message to the LPD server
  1680. X ***************************************************************************
  1681. X * Revision History: Created Sun Jan 24 06:32:54 CST 1988
  1682. X * $Log:    startserver.c,v $
  1683. X * Revision 3.1  88/06/18  09:35:52  papowell
  1684. X * Version 3.0- Distributed Sat Jun 18 1988
  1685. X * 
  1686. X * Revision 2.1  88/05/09  10:10:34  papowell
  1687. X * PLP: Released Version
  1688. X * 
  1689. X * Revision 1.3  88/04/06  12:13:02  papowell
  1690. X * Minor updates, changes in error message formats.
  1691. X * Elimination of the AF_UNIX connections, use AF_INET only.
  1692. X * Better error messages.
  1693. X * 
  1694. X * Revision 1.2  88/03/25  15:01:53  papowell
  1695. X * Debugged Version:
  1696. X * 1. Added the PLP control file first transfer
  1697. X * 2. Checks for MX during file transfers
  1698. X * 3. Found and fixed a mysterious bug involving the SYSLOG facilities;
  1699. X *     apparently they open files and then assume that they will stay
  1700. X *     open.
  1701. X * 4. Made sure that stdin, stdout, stderr was available at all times.
  1702. X * 
  1703. X * Revision 1.1  88/03/01  11:09:22  papowell
  1704. X * Initial revision
  1705. X * 
  1706. X ***************************************************************************/
  1707. X/***************************************************************************
  1708. X * Startserver()
  1709. X * This originally used to use the UNIX domain sockets,  but now uses the
  1710. X * AF_INET domain sockets.  The actual sending is done by calling
  1711. X * Remote_start,  after setting the RP (remote printer) and RM fields
  1712. X * appropriately.
  1713. X * 1. Save the RP and RM values.
  1714. X * 2. Set RP to Printer and RM to Host
  1715. X * 3. If you are running NW, start the remote one
  1716. X * 4. Send the start message.
  1717. X * 5. Restore RP and RM
  1718. X * 6. Return success indication
  1719. X ***************************************************************************/
  1720. X#ifndef lint
  1721. static char id_str1[] =
  1722. X    "$Header: startserver.c,v 3.1 88/06/18 09:35:52 papowell Exp $ PLP Copyright 1988 Patrick Powell";
  1723. X#endif lint
  1724. X#include "lp.h"
  1725. X
  1726. Startserver()
  1727. X{
  1728. X    char *old_RP, *old_RM;            /* original RP and RM values */
  1729. X
  1730. X    old_RP = RP;
  1731. X    old_RM = RM;
  1732. X
  1733. X    RP = Printer;
  1734. X    RM = Host;
  1735. X    if( NW ){
  1736. X        RP = old_RP;
  1737. X        RM = old_RM;
  1738. X    }
  1739. X    if( Remote_start() == 0 ){
  1740. X        logerr(XLOG_INFO,"Startserver: host '%s' server for '%s' not started",
  1741. X            Host, Printer);
  1742. X    }
  1743. X    RP = old_RP;
  1744. X    RM = old_RM;
  1745. X}
  1746. END_OF_FILE
  1747. if test 2442 -ne `wc -c <'src/startserver.c'`; then
  1748.     echo shar: \"'src/startserver.c'\" unpacked with wrong size!
  1749. fi
  1750. # end of 'src/startserver.c'
  1751. fi
  1752. if test -f 'src/termclear.c' -a "${1}" != "-c" ; then 
  1753.   echo shar: Will not clobber existing file \"'src/termclear.c'\"
  1754. else
  1755. echo shar: Extracting \"'src/termclear.c'\" \(2708 characters\)
  1756. sed "s/^X//" >'src/termclear.c' <<'END_OF_FILE'
  1757. X/***************************************************************************
  1758. X * U. Minnesota LPD Software * Copyright 1987, 1988, Patrick Powell
  1759. X ***************************************************************************
  1760. X * MODULE: termclear.c
  1761. X ***************************************************************************
  1762. X * Revision History: Created Mon Feb  1 18:06:56 CST 1988
  1763. X * $Log:    termclear.c,v $
  1764. X * Revision 3.1  88/06/18  09:35:54  papowell
  1765. X * Version 3.0- Distributed Sat Jun 18 1988
  1766. X * 
  1767. X * Revision 2.1  88/05/09  10:10:38  papowell
  1768. X * PLP: Released Version
  1769. X * 
  1770. X * Revision 1.3  88/04/08  08:49:17  papowell
  1771. X * Added <sys/types.h>, <sgtty.h> to includes
  1772. X * 
  1773. X * Revision 1.2  88/03/11  19:29:41  papowell
  1774. X * Minor Changes, Updates
  1775. X * 
  1776. X * Revision 1.1  88/03/01  11:09:26  papowell
  1777. X * Initial revision
  1778. X * 
  1779. X ***************************************************************************/
  1780. X#ifndef lint
  1781. static char id_str1[] =
  1782. X    "$Header: termclear.c,v 3.1 88/06/18 09:35:54 papowell Exp $ PLP Copyright 1988 Patrick Powell";
  1783. X#endif lint
  1784. X
  1785. X/***************************************************************************
  1786. X * Term_clear()
  1787. X * 1. Do the initialization if neccessary
  1788. X * 2. clear the screen using the termcap information
  1789. X * This code was taken from "Screen Updating and Cursor Movement Optimization
  1790. X * A Library Package", by Ken. C. Arnold;  with 4.3BSD Release,
  1791. X * Programmers Reference Manual
  1792. X ***************************************************************************/
  1793. static int tinit_done;
  1794. static int is_term;
  1795. X
  1796. X#ifdef TERMCAP
  1797. X#include <stdio.h>
  1798. X#include <sys/types.h>
  1799. X#include <sgtty.h>
  1800. X#include <curses.h>
  1801. X
  1802. char *getenv();
  1803. extern int XLOG_INFO;
  1804. X/***************************************************************************
  1805. X * definitions for TERMCAP
  1806. X ***************************************************************************/
  1807. char bp[1024];
  1808. char xp[1024];
  1809. char *area = xp;
  1810. short ospeed;
  1811. struct sgttyb sbuf;
  1812. char *TI;
  1813. char *TE;
  1814. char *CL;
  1815. char *tgetstr();
  1816. X
  1817. pputs( c )
  1818. X    int c;
  1819. X{
  1820. X    putchar( c );
  1821. X}
  1822. X
  1823. X
  1824. Term_clear()
  1825. X{
  1826. X    char *sp;
  1827. X    if( tinit_done == 0 ){
  1828. X        tinit_done = 1;
  1829. X        /*
  1830. X         * set things up
  1831. X         */
  1832. X        if( isatty(0) && (sp = getenv( "TERM" )) != NULL ){
  1833. X            /* get the speed */
  1834. X            if( ioctl(1, TIOCGETP, &sbuf) < 0 ){
  1835. X                logerr_die( XLOG_INFO,"ioctl on output failed" );
  1836. X            }
  1837. X            ospeed = sbuf.sg_ospeed;
  1838. X            if( tgetent( bp, sp ) > 0 ){
  1839. X                TI = tgetstr( "ti", &area );
  1840. X                TE = tgetstr( "te", &area );
  1841. X                CL = tgetstr( "cl", &area );
  1842. X            }
  1843. X            if( TI ){
  1844. X                tputs( TI, 0, pputs );
  1845. X            }
  1846. X            is_term = 1;
  1847. X        }
  1848. X    }
  1849. X    if( is_term && CL ){
  1850. X        tputs( CL, 0, pputs );
  1851. X    }
  1852. X}
  1853. X
  1854. Term_finish()
  1855. X{
  1856. X    if( is_term && TE ){
  1857. X            tputs( TE, 0, pputs );
  1858. X    }
  1859. X}
  1860. X#else TERMCAP
  1861. Term_clear()
  1862. X{ ; }
  1863. Term_finish()
  1864. X{ ; }
  1865. X#endif TERMCAP
  1866. END_OF_FILE
  1867. if test 2708 -ne `wc -c <'src/termclear.c'`; then
  1868.     echo shar: \"'src/termclear.c'\" unpacked with wrong size!
  1869. fi
  1870. # end of 'src/termclear.c'
  1871. fi
  1872. if test -f 'utilities/cpr/cpr.1' -a "${1}" != "-c" ; then 
  1873.   echo shar: Will not clobber existing file \"'utilities/cpr/cpr.1'\"
  1874. else
  1875. echo shar: Extracting \"'utilities/cpr/cpr.1'\" \(3315 characters\)
  1876. sed "s/^X//" >'utilities/cpr/cpr.1' <<'END_OF_FILE'
  1877. X.TH CPR PUBLIC UW 
  1878. X.SH "NAME"
  1879. cpr  \-  print 'C' files
  1880. X.SH "SYNOPSIS"
  1881. X.B public cpr
  1882. X[ -l # ] [ -n ] [ -r[n] ] [ -s ] [-t tabwidth] [-p proportion]
  1883. X[ file ] ...
  1884. X.SH "DESCRIPTION"
  1885. X.I Cpr
  1886. prints the files named in its argument list, preceding
  1887. the output with a table of contents. Each file is assumed to be C
  1888. source code (but doesn't have to be) in that the program searches
  1889. for the beginning and end of functions. Function names are added to
  1890. the table of contents, provided the name starts at the beginning of
  1891. a line. The function name in the output is double struck.
  1892. X.PP
  1893. By default, blank lines are inserted after every closing '}'
  1894. character. Thus functions and structure declarations are nicely
  1895. isolated in the output. The only drawback to this is that structure
  1896. initialization tables sometimes produce lots of white space.
  1897. The \fB\-r\fP[n] option changes the space left to the specified
  1898. number of lines.  If no number is specified, no space is left.
  1899. X.PP
  1900. The option \fB\-l\fP indicates that the following argument is to be
  1901. the page length used for output, rather
  1902. than the default 66 lines (changing the page length hasn't been
  1903. tested much).
  1904. X.PP
  1905. The option \fB\-s\fP indicates that the table of contents should be sorted
  1906. by function name within each file.
  1907. X.PP
  1908. The option \fB\-n\fP indicates that output lines should be numbered with
  1909. the corresponding line number from the input file.
  1910. X.PP
  1911. The option \fB\-t\fI\ tabwidth\fR
  1912. causes output to be produced that will look correct with tabs expanded every
  1913. X.I tabwith
  1914. columns.
  1915. X(The default is every 8 columns.)
  1916. A
  1917. X.I tabwidth
  1918. of zero suppresses use of tabs; all output will be spaced using blanks.
  1919. X.PP
  1920. The option
  1921. X.B -p proportion
  1922. indicates what proportion of the page in steps of 16
  1923. should be used for deciding if a new function needs a new page.
  1924. That is -p12 (the default) indicates that if a function starts
  1925. within the top 12/16 (3/4) of the page then do it, otherwise put it
  1926. on a new page.
  1927. Thus the higher the number (up to 16) the closer to
  1928. the bottom of the page will functions be started.
  1929. X.B -p0
  1930. says put each function on a new page.
  1931. X.SH "FILES"
  1932. X.nf
  1933. X/tmp/cpr$$        \- temp files holding text
  1934. X.fi
  1935. X.SH "SEE ALSO"
  1936. cb(1), cat(1), fold(1), num(1), pr(1)
  1937. X.SH "DIAGNOSTICS"
  1938. Various messages about being unable to open files.
  1939. Self explanatory.
  1940. X.SH "BUGS"
  1941. This program is
  1942. unable to find function names that do not begin at the left margin.
  1943. It sometimes thinks some declarations are functions.
  1944. Use of macros to define functions will also confuse it.
  1945. Comments are not recognized, and #ifdef's are not processed,
  1946. so stuff inside them gets interpreted.
  1947. If the same function definition appears multiple times on the same page,
  1948. only one entry is made in the table of contents, to reduce the number
  1949. of redundant entries.
  1950. X.SH "AUTHOR"
  1951. X.nf
  1952. X.ta 3i
  1953. Paul Breslin\toriginal
  1954. Human Computing Resources Corp.
  1955. X.sp 0.5v
  1956. Rick Wise\tsorting, and use of standard input
  1957. CALCULON Corp.
  1958. X.sp 0.5v
  1959. David Wasley\tnumbering, times, etc.
  1960. U. C. Berkley.
  1961. X.sp 0.5v
  1962. Patrick Powell\tvariable number of lines between functions
  1963. University of Waterloo
  1964. X.sp 0.5v
  1965. Ian! D. Allen\tvariable tabs; redundant TOC suppression
  1966. University of Waterloo
  1967. X.sp 0.5v
  1968. Dennis Vadura\t-p option, better function recognition
  1969. University of Waterloo
  1970. X.fi
  1971. X.SH SUPPORT
  1972. This software is
  1973. X.I not
  1974. supported by
  1975. anybody.
  1976. Public Domain.
  1977. Caveat Emptor.
  1978. END_OF_FILE
  1979. if test 3315 -ne `wc -c <'utilities/cpr/cpr.1'`; then
  1980.     echo shar: \"'utilities/cpr/cpr.1'\" unpacked with wrong size!
  1981. fi
  1982. # end of 'utilities/cpr/cpr.1'
  1983. fi
  1984. echo shar: End of archive 2 \(of 16\).
  1985. cp /dev/null ark2isdone
  1986. MISSING=""
  1987. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ; do
  1988.     if test ! -f ark${I}isdone ; then
  1989.     MISSING="${MISSING} ${I}"
  1990.     fi
  1991. done
  1992. if test "${MISSING}" = "" ; then
  1993.     echo You have unpacked all 16 archives.
  1994.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1995. else
  1996.     echo You still need to unpack the following archives:
  1997.     echo "        " ${MISSING}
  1998. fi
  1999. ##  End of shell archive.
  2000. exit 0
  2001.  
  2002. -- 
  2003. Please send comp.sources.unix-related mail to rsalz@uunet.uu.net.
  2004.